package com.maixun.lib_comment.recyclerview

import android.view.View
import android.view.ViewGroup
import com.lmoumou.lib_comment.CommentImageLoader

/**
 * 作者：Lmoumou
 * 时间：2020/8/5 16:03
 */
interface BaseViewHolder {
    /**
     * 获取View
     *
     * @param viewId
     * @return View
     * */
    fun <T : View> getView(viewId: Int): T

    /**
     * 获取ViewGroup
     *
     * @param viewId
     * @return ViewGroup
     * */
    fun <T : ViewGroup> getViewGroup(viewId: Int): T

    /**
     * 给TextView设置文本
     *
     * @param viewId
     * @param content
     * */
    fun setText(viewId: Int, content: CharSequence): BaseViewHolder

    /**
     * 加载本地资源图片
     *
     * @param viewId
     * @param resId
     * */
    fun setImageResource(viewId: Int, resId: Int): BaseViewHolder

    /**
     * 加载图片
     *
     * @param viewId
     * @param picturePath
     * @param imageLoader
     * */
    fun loadPicture(viewId: Int, picturePath: String, imageLoader: ViewHolderImpl.HolderImageLoader = CommentImageLoader())
}